package com.zmn.oms.admin.controller.work.list;

import com.alibaba.fastjson.JSON;
import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.vo.work.erp.SharingEstimateVO;
import com.zmn.oms.business.interfaces.work.OrderWorkERPQueryBService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author sunlife
 * @date:2020/10/16 11:38 上午
 * description:
 */
@Controller
@Slf4j
@RequestMapping("/work/erp")
public class WorkErpListController {
    @Autowired
    OrderWorkERPQueryBService orderWorkERPQueryBService;

    @RequestMapping("sharingestimate")
    private ModelAndView sharingestimate(@RequestParam("orderId") Long orderId, @RequestParam("workId") Long workId) throws OmsBaseException {
        ModelAndView mv = new ModelAndView("work/detailsubmodule/sharingestimate");
        
        SharingEstimateVO sharingEstimate = orderWorkERPQueryBService.findSharingEstimate(orderId, workId, false, false);
        mv.addObject("sharingEstimate", sharingEstimate);

        return mv;
    }
}
